﻿using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.Common;
using HumanManagement.BusinessObjects;
using HumanManagement.DataAccess;

namespace HumanManagement.BusinessLogic
{
	public class ProfessionalKnowledgeMajorBL
	{

		#region ***** Init Methods ***** 
		ProfessionalKnowledgeMajorDA objProfessionalKnowledgeMajorDA;
		public ProfessionalKnowledgeMajorBL()
		{
			objProfessionalKnowledgeMajorDA = new ProfessionalKnowledgeMajorDA();
		}
		#endregion

		#region ***** Get Methods ***** 
		/// <summary>
		/// Get ProfessionalKnowledgeMajor by id
		/// </summary>
		/// <param name="id">ID</param>
		/// <returns>ProfessionalKnowledgeMajor</returns>
		public ProfessionalKnowledgeMajor GetByID(int id)
		{
			return objProfessionalKnowledgeMajorDA.GetByID(id);
		}

		/// <summary>
		/// Get all of ProfessionalKnowledgeMajor
		/// </summary>
		/// <returns>List<<ProfessionalKnowledgeMajor>></returns>
		public List<ProfessionalKnowledgeMajor> GetList()
		{
			string cacheName = "lstProfessionalKnowledgeMajor";
			if( ServerCache.Get(cacheName) == null )
			{
				ServerCache.Insert(cacheName, objProfessionalKnowledgeMajorDA.GetList(), "ProfessionalKnowledgeMajor");
			}
			return (List<ProfessionalKnowledgeMajor>) ServerCache.Get(cacheName);
		}

		/// <summary>
		/// Get DataSet of ProfessionalKnowledgeMajor
		/// </summary>
		/// <returns>DataSet</returns>
		public DataSet GetDataSet()
		{
			string cacheName = "dsProfessionalKnowledgeMajor";
			if( ServerCache.Get(cacheName) == null )
			{
				ServerCache.Insert(cacheName, objProfessionalKnowledgeMajorDA.GetDataSet(), "ProfessionalKnowledgeMajor");
			}
			return (DataSet) ServerCache.Get(cacheName);
		}


		/// <summary>
		/// Get all of ProfessionalKnowledgeMajor paged
		/// </summary>
		/// <param name="recperpage">recperpage</param>
		/// <param name="pageindex">pageindex</param>
		/// <returns>List<<ProfessionalKnowledgeMajor>></returns>
		public List<ProfessionalKnowledgeMajor> GetListPaged(int recperpage, int pageindex)
		{
			return objProfessionalKnowledgeMajorDA.GetListPaged(recperpage, pageindex);
		}

		/// <summary>
		/// Get DataSet of ProfessionalKnowledgeMajor paged
		/// </summary>
		/// <param name="recperpage">recperpage</param>
		/// <param name="pageindex">pageindex</param>
		/// <returns>DataSet</returns>
		public DataSet GetDataSetPaged(int recperpage, int pageindex)
		{
			return objProfessionalKnowledgeMajorDA.GetDataSetPaged(recperpage, pageindex);
		}





		#endregion

		#region ***** Add Update Delete Methods ***** 
		/// <summary>
		/// Add a new ProfessionalKnowledgeMajor within ProfessionalKnowledgeMajor database table
		/// </summary>
		/// <param name="obj_professionalknowledgemajor">ProfessionalKnowledgeMajor</param>
		/// <returns>key of table</returns>
		public int Add(ProfessionalKnowledgeMajor obj_professionalknowledgemajor)
		{
			ServerCache.Remove("ProfessionalKnowledgeMajor", true);
			return objProfessionalKnowledgeMajorDA.Add(obj_professionalknowledgemajor);
		}

		/// <summary>
		/// updates the specified ProfessionalKnowledgeMajor
		/// </summary>
		/// <param name="obj_professionalknowledgemajor">ProfessionalKnowledgeMajor</param>
		/// <returns></returns>
		public void Update(ProfessionalKnowledgeMajor obj_professionalknowledgemajor)
		{
			ServerCache.Remove("ProfessionalKnowledgeMajor", true);
			objProfessionalKnowledgeMajorDA.Update(obj_professionalknowledgemajor);
		}

		/// <summary>
		/// Delete the specified ProfessionalKnowledgeMajor
		/// </summary>
		/// <param name="id">ID</param>
		/// <returns></returns>
		public void Delete(int id)
		{
			ServerCache.Remove("ProfessionalKnowledgeMajor", true);
			objProfessionalKnowledgeMajorDA.Delete(id);
		}
		#endregion
	}
}
